import type { IColumnsOption } from 'vc';
import { INDEX, COMPANY_NAME, BUSINESS_DATA, REGISTERED_CAPITAL, PROVINCE, CITY, COUNTRY, INDUSTRY_CATEGORY, INFO_SOURCE } from '@/utils/tableColumn';

export function useTable() {
  const columns = ref<IColumnsOption[]>([
    { ...INDEX },
    { ...COMPANY_NAME },
    {
      title: '证书编号',
      field: 'evaluationLevelCode12',
      minWidth: '220',
      align: 'center'
    },
    {
      minWidth: 100,
      field: 'evaluationLevelCode1',
      title: '证书状态',
      slots: {
        default: ({ row }) => {
          return <></>;
        }
      }
    },
    {
      width: 120,
      align: 'center',
      title: '产品名称及单元',
      field: 'evaluationLevelCode'
    },
    {
      width: 100,
      title: '规格型号',
      field: 'statisticalYear'
    },
    {
      width: 100,
      title: '认证领域',
      field: 'productName'
    },
    {
      width: 150,
      title: '认证标准',
      field: 'unitEnergyConsumption'
    },
    {
      title: '发证日期',
      field: 'noticeDate',
      width: 110,
      align: 'center',
      sortable: true
    },
    {
      title: '到期日期',
      field: 'noticeDate1',
      width: 110,
      align: 'center',
      sortable: true
    },
    {
      minWidth: 170,
      field: 'evaluationAuthority',
      title: '发证机关'
    },
    {
      ...INFO_SOURCE,
      field: 'evaluationLevelCode13'
    },
    { ...PROVINCE },
    { ...CITY },
    { ...COUNTRY },
    { ...INDUSTRY_CATEGORY },
    { ...BUSINESS_DATA },
    { ...REGISTERED_CAPITAL }
  ]);

  return {
    columns
  };
}
